import Vue from "vue";

Vue.directive("focus", {
  inserted: function(el) {
    // 获取焦点
    el.focus();
  }
});

Vue.directive("numberOnly", {
  inserted: function(el) {
    // 获取焦点
     el.handler = function () {
        
      el.value = el.value.replace(/[^\d]/g, "");
    };
    el.addEventListener("input", el.handler);
  }
});
